import { request } from 'umi';
import { createCRUD } from '@/utils/api';

const route = '/role';

const crud = createCRUD<RoleEntity>(route);

export { crud };

export async function getRole(id: string) {
  return await request<RoleEntity>(`${route}/get_entity?id=${id}`, {
    method: 'GET',
  });
}

export async function getRoleOptions(tenant_id: string) {
  return await request<OptionEntity[]>(`${route}/get_role_options?tenant_id=${tenant_id}`, {
    method: 'GET',
  });
}
